package com.example.demo;

import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 控制器
 * @author QuiFar
 * @date 2017年10月20日 下午4:12:30
 * @version V1.0
 */

@RestController
@RequestMapping(path = "/")
public class ControllerTest {

	@Autowired
	private Producer producer;

	@GetMapping("sendMsg")
	public String sendMsg(@RequestParam String message) {
		producer.sendMessage(new ActiveMQQueue("sample.queue"), message);
		return "ok";
	}
}
